package small.woods.mskafka.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.integration.support.MessageBuilder;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import small.woods.mskafka.stream.IMessageProvider;

/**
 * @description:
 * @author: yutingting
 * @create: 2022-01-13 10:45
 **/
@RestController
@RequestMapping("/kafka")
public class SendMessageController {
    @Autowired
    private IMessageProvider IMessageProvider;

    @GetMapping("/send")
    public void send() {
//        System.out.println("Hello World...");
        MessageBuilder<String> ssss = MessageBuilder.withPayload("ssss");
        IMessageProvider.testOut().send(ssss.build());
    }
}
